/**
* Copyright (c) By zengqh.
*
* This program is just for fun or demo, in the hope that it  
* will be useful, you can redistribute it and/or modify freely.
*
* Time: 2012/11/06
* File: EnnPrerequisites.h
* Blog: http://www.cnblogs.com/zengqh/
**/

#ifndef EnnPrerequisites_h__
#define EnnPrerequisites_h__

#include "EnnPlatform.h"					/* Platform */
#include "EnnPocoHeader.h"					/* The base poco library */
#include "EnnMemoryAllocatorConfig.h"
#include "EnnStdHeaders.h"

namespace Enn
{
/** In order to avoid finger-aches :) */
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;

// define the real number values to be used
// default to use 'float' unless pre compiler option set
#if ENN_DOUBLE_PRECISION == 1
typedef double Real;
#else
typedef float Real;
#endif
}

/** Stl container */
namespace Enn
{
	template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> > 
	struct deque 
	{ 
		typedef typename std::deque<T, A> type;    
		typedef typename std::deque<T, A>::iterator iterator;
		typedef typename std::deque<T, A>::const_iterator const_iterator;
	}; 

	template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> > 
	struct vector 
	{ 
		typedef typename std::vector<T, A> type;
		typedef typename std::vector<T, A>::iterator iterator;
		typedef typename std::vector<T, A>::const_iterator const_iterator;
	}; 

	template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> > 
	struct list
	{
		typedef typename std::list<T, A> type;
		typedef typename std::list<T, A>::iterator iterator;
		typedef typename std::list<T, A>::const_iterator const_iterator;
	};

	template <typename T, typename P = std::less<T>, typename A = STLAllocator<T, GeneralAllocPolicy> > 
	struct set 
	{
		typedef typename std::set<T, P, A> type;
		typedef typename std::set<T, P, A>::iterator iterator;
		typedef typename std::set<T, P, A>::const_iterator const_iterator;
	};

	template <typename K, typename V, typename P = std::less<K>, typename A = STLAllocator<std::pair<const K, V>, GeneralAllocPolicy> > 
	struct map 
	{
		typedef typename std::map<K, V, P, A> type;
		typedef typename std::map<K, V, P, A>::iterator iterator;
		typedef typename std::map<K, V, P, A>::const_iterator const_iterator;
	};

	template <typename K, typename V, typename P = std::less<K>, typename A = STLAllocator<std::pair<const K, V>, GeneralAllocPolicy> > 
	struct multimap
	{
		typedef typename std::multimap<K, V, P, A> type;
		typedef typename std::multimap<K, V, P, A>::iterator iterator;
		typedef typename std::multimap<K, V, P, A>::const_iterator const_iterator;
	};

	/** string */
	typedef std::basic_string<char, std::char_traits<char>, STLAllocator<char,GeneralAllocPolicy > >	_StringBase;
	typedef _StringBase String;

	typedef std::basic_stringstream<char,std::char_traits<char>,STLAllocator<char,GeneralAllocPolicy > > _StringStreamBase;
	typedef _StringStreamBase StringStream;
	typedef StringStream stringstream;
}

namespace Enn
{
	template <typename T>
	struct SharedPtr
	{
		typedef Poco::SharedPtr<T>	type;
	};
}

/** Hash map */
namespace Enn
{
#if ENN_COMPILER == ENN_COMPILER_GNUC && ENN_COMP_VER >= 310
#   if ENN_COMP_VER >= 430
#       define HashMap ::std::tr1::unordered_map
#		define HashSet ::std::tr1::unordered_set
#    else
#       define HashMap ::__gnu_cxx::hash_map
#       define HashSet ::__gnu_cxx::hash_set
#    endif
#elif ENN_COMPILER == ENN_COMPILER_MSVC
#       if ENN_COMP_VER >= 1500 // VC++ 9.0, sp1.
#			define HashMap ::std::tr1::unordered_map
#           define HashSet ::std::tr1::unordered_set
#		elif ENN_COMP_VER > 1300 && !defined(_STLP_MSVC)
#           define HashMap ::stdext::hash_map
#           define HashSet ::stdext::hash_set
#       else
#           define HashMap ::std::hash_map
#           define HashSet ::std::hash_set
#       endif
#else
#       define HashMap ::std::hash_map
#       define HashSet ::std::hash_set
#endif
}

/** Class declaration */
namespace Enn
{
	typedef Poco::Thread		Thread;
	typedef Poco::Runnable		Runnable;
	typedef Poco::File			File;
	typedef Poco::Path			Path;
	class						DataStream;
	class						Degree;
	class						Radian;
	class						Math;
	class						Angle;
	class						Vector2;
	class						Vector3;
	class						Vector4;
	class						Quaternion;
	class						StringUtil;
	class						Sphere;
	class						AxisAlignedBox;
	class						PlaneBoundedVolume;
	class						Plane;
	class						Matrix3;
	class						Matrix4;
	class						Ray;
	class						SceneNode;
	class						MovableObject;
	class						SceneManager;
	class						HardwareBuffer;
	class						HardwareVertexBuffer;
	class						HardwareBufferManagerBase;
}

/** Assert */
#define ENN_ASSERT(value)

#endif    /* EnnPrerequisites_h__ */